import request from '@/utils/request';

/**
 * @description 菜单列表
 * @param
 * @returns
 */
export async function accessList(data) {
	return request({
		url: '/Access/index',
		method: 'post',
		data,
	});
}
/**
 * @description 添加菜单
 * @param
 * @returns
 */
export async function addpAccess(data) {
	return request({
		url: '/Access/add',
		method: 'post',
		data,
	});
}
/**
 * @description 编辑菜单
 * @param
 * @returns
 */
export async function editAccess(data) {
	return request({
		url: '/Access/edit',
		method: 'post',
		data,
	});
}
/**
 * @description 删除菜单
 * @param
 * @returns
 */
export async function delAccess(data) {
	return request({
		url: '/Access/delete',
		method: 'post',
		data,
	});
}
/**
 * @description 修改状态
 * @param
 * @returns
 */
export async function status(data) {
	return request({
		url: '/Access/status',
		method: 'post',
		data,
	});
}
/**
 * @description 菜单列表
 * @param
 * @returns
 */
export async function supplieraccessList(data) {
	return request({
		url: '/SupplierAccess/index',
		method: 'post',
		data,
	});
}
/**
 * @description 添加菜单
 * @param
 * @returns
 */
export async function supplieraddpAccess(data) {
	return request({
		url: '/SupplierAccess/add',
		method: 'post',
		data,
	});
}
/**
 * @description 编辑菜单
 * @param
 * @returns
 */
export async function suppliereditAccess(data) {
	return request({
		url: '/SupplierAccess/edit',
		method: 'post',
		data,
	});
}
/**
 * @description 删除菜单
 * @param
 * @returns
 */
export async function supplierdelAccess(data) {
	return request({
		url: '/SupplierAccess/delete',
		method: 'post',
		data,
	});
}
/**
 * @description 修改状态
 * @param
 * @returns
 */
export async function supplierstatus(data) {
	return request({
		url: '/SupplierAccess/status',
		method: 'post',
		data,
	});
}

export const appAccessApi = async (id) => {
	return request({
		url: 'appAccess/'+id,
		method: 'get',
	});
}
export const setAppAccess = async (data) => {
	return request({
		url: 'appAccess',
		method: 'post',
		data,
	});
}

/**
 * @description saas菜单列表
 * @param
 * @returns
 */
export async function adminAccessList(data) {
	return request({
		url: '/AdminAccess/index',
		method: 'post',
		data,
	});
}
/**
 * @description 添加菜单
 * @param
 * @returns
 */
export async function addAdminAccess(data) {
	return request({
		url: '/AdminAccess/add',
		method: 'post',
		data,
	});
}
/**
 * @description 编辑菜单
 * @param
 * @returns
 */
export async function editAdminAccess(data) {
	return request({
		url: '/AdminAccess/edit',
		method: 'post',
		data,
	});
}
/**
 * @description 删除菜单
 * @param
 * @returns
 */
export async function delAdminAccess(data) {
	return request({
		url: '/AdminAccess/delete',
		method: 'post',
		data,
	});
}
/**
 * @description 修改状态
 * @param
 * @returns
 */
export async function adminAccessStatus(data) {
	return request({
		url: '/AdminAccess/status',
		method: 'post',
		data,
	});
}

/**
 * @description 我的菜单
 * @param
 * @returns
 */
export async function getRoleMenu(data) {
	return request({
		url: '/AdminAccess/role_menu',
		method: 'post',
		data,
	});
}